import http from '@/api/http.js'

export default async function () {
    let fileds = [
        'cfg_m_phone',
        'cfg_m_wap_link',
        'cfg_m_wap_en_id',
        'cfg_indextitle',
        'cfg_home_page_title',
        'cfg_satisfy',
        'cfg_question_is_show',
        //评论开关
        'cfg_comment_line_lock',
        'cfg_comment_hotel_lock',
        'cfg_comment_car_lock',
        'cfg_comment_article_lock',
        'cfg_comment_spot_lock',
        'cfg_comment_photo_lock',
        'cfg_comment_jieban_lock',
        'cfg_comment_tuan_lock',
        'cfg_comment_malls_lock',
        'cfg_comment_ship_line_lock',
        'cfg_comment_outdoor_lock',
        'cfg_comment_visa_lock',
        'cfg_comment_techan_lock',
        'cfg_comment_food_lock',
        'cfg_comment_tongyong_lock',
        'cfg_comment_notes_lock',
        'cfg_comment_news_lock',
        'cfg_comment_guide_lock',
        'cfg_wxxcx_fuwu',
        'cfg_wxxcx_xinxi',

        'cfg_mobile_foot_content',
		'cfg_weixin_personal_info',
		'cfg_weixin_personal_note_lock'
    ]

 

    // #ifdef MP-TOUTIAO
    fileds.push('cfg_toutiao_danbao_status')
    fileds.push('cfg_toutiao_open_customer_service')
    fileds.push('cfg_toutiao_trade_is_open')
    // #endif

    let params,
        infoRes,
        filed = fileds.join(',')
    params = {
        method: 'api/v2/system/get_sys_configs',
        filed: filed
    }
    infoRes = await http(params)
    uni.setStorageSync('cfg_m_phone', infoRes.data.cfg_m_phone)
    uni.setStorageSync('cfg_m_wap_link', infoRes.data.cfg_m_wap_link)
    uni.setStorageSync('cfg_m_wap_en_id', infoRes.data.cfg_m_wap_en_id)
    uni.setStorageSync('cfg_indextitle', infoRes.data.cfg_indextitle)
    uni.setStorageSync('cfg_home_page_title', infoRes.data.cfg_home_page_title)
    uni.setStorageSync('cfg_satisfy', infoRes.data.cfg_satisfy)
    uni.setStorageSync('cfg_question_is_show', infoRes.data.cfg_question_is_show)
    //评论开关

    uni.setStorageSync('cfg_comment_line_lock', infoRes.data.cfg_comment_line_lock)
    uni.setStorageSync('cfg_comment_hotel_lock', infoRes.data.cfg_comment_hotel_lock)
    uni.setStorageSync('cfg_comment_car_lock', infoRes.data.cfg_comment_car_lock)
    uni.setStorageSync('cfg_comment_article_lock', infoRes.data.cfg_comment_article_lock)
    uni.setStorageSync('cfg_comment_spot_lock', infoRes.data.cfg_comment_spot_lock)
    uni.setStorageSync('cfg_comment_photo_lock', infoRes.data.cfg_comment_photo_lock)
    uni.setStorageSync('cfg_comment_jieban_lock', infoRes.data.cfg_comment_jieban_lock)
    uni.setStorageSync('cfg_comment_tuan_lock', infoRes.data.cfg_comment_tuan_lock)
    uni.setStorageSync('cfg_comment_malls_lock', infoRes.data.cfg_comment_malls_lock)
    uni.setStorageSync('cfg_comment_ship_line_lock', infoRes.data.cfg_comment_ship_line_lock)
    uni.setStorageSync('cfg_comment_guide_lock', infoRes.data.cfg_comment_guide_lock)
    uni.setStorageSync('cfg_comment_outdoor_lock', infoRes.data.cfg_comment_outdoor_lock)
    uni.setStorageSync('cfg_comment_visa_lock', infoRes.data.cfg_comment_visa_lock)
    uni.setStorageSync('cfg_comment_techan_lock', infoRes.data.cfg_comment_techan_lock)
    uni.setStorageSync('cfg_comment_food_lock', infoRes.data.cfg_comment_food_lock)
    uni.setStorageSync('cfg_comment_tongyong_lock', infoRes.data.cfg_comment_tongyong_lock)
    uni.setStorageSync('cfg_comment_notes_lock', infoRes.data.cfg_comment_notes_lock)
    uni.setStorageSync('cfg_comment_news_lock', infoRes.data.cfg_comment_news_lock)

    uni.setStorageSync('cfg_mobile_foot_content', infoRes.data.cfg_mobile_foot_content)

    uni.setStorageSync('cfg_weixin_personal_info', infoRes.data.cfg_weixin_personal_info)
    uni.setStorageSync('cfg_weixin_personal_note_lock', infoRes.data.cfg_weixin_personal_note_lock)
    uni.setStorageSync('cfg_wxxcx_fuwu', infoRes.data.cfg_wxxcx_fuwu)
    uni.setStorageSync('cfg_wxxcx_xinxi', infoRes.data.cfg_wxxcx_xinxi)

    // #ifdef MP-TOUTIAO
    uni.setStorageSync('cfg_toutiao_danbao_status', infoRes.data.cfg_toutiao_danbao_status)
    uni.setStorageSync(
        'cfg_toutiao_open_customer_service',
        infoRes.data.cfg_toutiao_open_customer_service ? infoRes.data.cfg_toutiao_open_customer_service : ''
    )
    uni.setStorageSync(
        'cfg_toutiao_trade_is_open',
        infoRes.data.cfg_toutiao_trade_is_open ? infoRes.data.cfg_toutiao_trade_is_open : ''
    )
    // #endif
}
